;
; SYSLIB Module Name:  SCIN
; Author:  Richard Conn
; SYSLIB Version Number:  2.0
; Module Version Number:  1.0
; Module Entry Points:
;	CIN
; Module External References:
;	None
;

;
;  CIN -- 
;	CONSOLE INPUT ROUTINE
;	INPUT CHARACTER FROM CON: INTO REG A
;	AFFECT ONLY REG A AND FLAGS
;	
PUTRG	MACRO
	PUSH	B	; SAVE BC, DE, HL
	PUSH	D
	PUSH	H
	ENDM
GETRG	MACRO
	POP	H	; RESTORE HL, DE, BC
	POP	D
	POP	B
	ENDM

CIN::
	PUTRG		; SAVE REGISTERS
	LHLD	JTABL	; GET ADDRESS OF JUMP TABLE
	MVI	L,CI$OFF	; CONSOLE INPUT ADR
	LXI	D,CRET1	; SET UP RET ADR
	PUSH	D	; ... ON STACK
	PCHL
CRET1:	GETRG		; RESTORE REGISTERS
	RET

BOOT	EQU	0	; CP/M BOOT ADDRESS
JTABL	EQU	BOOT+1	; CP/M JUMP TABLE ADDRESS
CI$OFF	EQU	9	; CONSOLE INPUT OFFSET

	END
